<div class="graph-annotation">
  <div class="graph-annotation__header">
    <div class="graph-annotation__user" bs-tooltip="'Created by {{ctrl.login}}'"></div>

    <div class="graph-annotation__title">
      <span ng-if="!ctrl.event.id">新建注释</span>
      <span ng-if="ctrl.event.id">编辑注释</span>
    </div>

    <div class="graph-annotation__time">{{ctrl.timeFormated}}</div>
  </div>

  <form name="ctrl.form" class="graph-annotation__body text-center">
    <div style="display: inline-block">
      <div class="gf-form gf-form--v-stretch">
        <span class="gf-form-label width-7">描述</span>
        <textarea class="gf-form-input width-20" rows="2" ng-model="ctrl.event.text" placeholder="描述"></textarea>
      </div>

      <div class="gf-form">
        <span class="gf-form-label width-7">标签</span>
        <bootstrap-tagsinput ng-model="ctrl.event.tags" tagclass="label label-tag" placeholder="添加标签">
        </bootstrap-tagsinput>
      </div>

      <div class="gf-form-button-row">
        <button type="submit" class="btn btn-primary" ng-click="ctrl.save()">保存</button>
        <button ng-if="ctrl.event.id" type="submit" class="btn btn-danger" ng-click="ctrl.delete()">删除</button>
        <a class="btn-text" ng-click="ctrl.close();">取消</a>
      </div>
    </div>
  </form>
</div>
